package com.agent.crm.sechdule.receiver;

import com.agent.crm.service.MonthYearService;
import com.agent.crm.service.SMS_Service;
import com.agent.crm.service.SechduleMainService;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;

public class BootBroadcastReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		// TODO Auto-generated method stub
		SharedPreferences preferences =context.getSharedPreferences("login_data", Context.MODE_PRIVATE);
		boolean startAppWhenBoot= preferences.getBoolean("startAppWhenBoot", true);
		if(startAppWhenBoot){
			Intent intentForRemind=new Intent(context,SechduleMainService.class);
			context.startService(intentForRemind);
	        Intent intentForSms=new Intent(context,SMS_Service.class);
	        context.startService(intentForSms);
	        Intent intentForMonthAndYearOperation=new Intent(context,MonthYearService.class);
	        context.startService(intentForMonthAndYearOperation);
		}
	}

}
